Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: create-cli cleanup #792

Merged
merged 25 commits into from
Aug 4, 2023
Merged

chore: create-cli cleanup #792

merged 25 commits into from
Aug 4, 2023

Conversation

danielpaulus
Copy link
Contributor

@danielpaulus danielpaulus commented Jul 5, 2023

I hereby confirm that I followed the code guidelines found at engineering guidelines

Affected Components

  • CLI
  • Create CLI
  • Test
  • Docs
  • Examples
  • Other

Notes for the Reviewer

Changes are described in #803

This PR adds a retry/fallback when the template download fails using the version tag/branch. If template couldn't be found, main branch is used to download the latest version. This is helpful when we change git tag format or versioning naming.

IMPORTANT: after merging this PR and releasing the new create-cli, the templates will be downloaded using the tag/branch without the v prefix. So, release's tags MUST be like 4.0.15.

TODO in a separated PR: try to rename prepare script with build
TODO in #814: add login and switch CLI commands E2E tests (using prompts.inject())

New Dependency Submission

@nahuelon nahuelon changed the title Umutuzgur/gh 0/create cli cleanup chore: create-cli cleanup Jul 26, 2023
@nahuelon
Copy link
Contributor

@umutuzgur , I opened #803 with some changes to be merged here, into this branch. I didn't commit into this branch because I would like to see how this branch is working in your local env. I tried a lot without success. The only way I found to make it work was removing all ESM references/packages. That's why I pushed all changes in a separated branch.

Nahuel Alejandro Ramos added 9 commits August 1, 2023 10:47
* chore: remove all ESM packages/references [gh-0]

* chore: add same fullname logic from fullname package [gh-0]

* fix: revert package.json build script to prepare

* chore: use commonjs deps versions [gh-0]

* chore: adjust template urls tag version [gh-0]

* chore: add create-cli E2E tests [gh-0]

* chore: add create-cli E2E tests [gh-0]

* chore: add create-cli E2E tests [gh-0]

* fix: execa version [gh-0]

* fix: execa version [gh-0]
@nahuelon nahuelon marked this pull request as ready for review August 1, 2023 16:54
@nahuelon nahuelon requested a review from umutuzgur August 1, 2023 16:54
umutuzgur
umutuzgur previously approved these changes Aug 2, 2023
Copy link
Member

@umutuzgur umutuzgur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you tested it thoroughly

@nahuelon nahuelon requested a review from umutuzgur August 2, 2023 20:09
@nahuelon
Copy link
Contributor

nahuelon commented Aug 2, 2023

@umutuzgur , I added a retrial mechanism when downloading the template from a specific version tag/branch. If the download fails (i.e. tag doesn't exists) the main branch is used to download the template.

@umutuzgur
Copy link
Member

@umutuzgur , I added a retrial mechanism when downloading the template from a specific version tag/branch. If the download fails (i.e. tag doesn't exists) the main branch is used to download the template.

@nahuelon is this for testing? If not, we don't need this. We shouldn't have a fallback for cases that are basically our mistakes

@nahuelon
Copy link
Contributor

nahuelon commented Aug 3, 2023

@umutuzgur , I added a retrial mechanism when downloading the template from a specific version tag/branch. If the download fails (i.e. tag doesn't exists) the main branch is used to download the template.

@nahuelon is this for testing? If not, we don't need this. We shouldn't have a fallback for cases that are basically our mistakes

@umutuzgur , I removed the 'fallback to main' retrial. Now, if we detects the create-cli version is 0.0.1-dev (which means it's a local env or a E2E) we replace it with the latest from NPM. This is useful mainly for the local development if you forgot to configure the CHECKLY_CLI_VERSION env var.
Also, I added a new E2E test forcing to use an older version (4.0.13 in this case).

@nahuelon nahuelon merged commit 0c27376 into main Aug 4, 2023
3 checks passed
@nahuelon nahuelon deleted the umutuzgur/gh-0/create-cli-cleanup branch August 4, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants